package com.example.mybaitsplus.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class User {
    @TableId(type = IdType.AUTO)                // 主键策略
    private Long id;
    private String name;
    private String pwd;
    private Double money;

    @TableField(fill = FieldFill.INSERT)        // 自动填充
    private LocalDateTime createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField(select = false)                 // 忽略该属性
    private String whatever;

}
